package com.woniuxy.signing.client;

import com.woniuxy.commons.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @auther 黄磊
 * @2022/8/7 19:27
 **/
@FeignClient(contextId = "studentSigningClient", name = "signing-server", path = "/signing")
public interface StudentSigningClient {

    /*
     * @Description:当前登录学生首次预约教练进行签约
     * @param coachId
     * @return: com.woniuxy.commons.util.Result
     * @Author: 黄磊
     * @Date: 2022/8/7 20:02
     */
    @GetMapping("/studentSigning/studentSigningCocah")
    Result studentSigningCocah(
            @Pattern(regexp = "-?\\d+(\\.\\d+)?", message = "教练id不是数字类型的字符串")
            @NotNull(message = "教练id不能是null")
            @NotBlank(message = "教练id不能是空字符串")
            @Min(value = 1, message = "教练id最小值为1")
            @RequestParam("coachId") String coachId,
            @RequestParam("loginStudentId") String loginStudentId
    );
}
